import edittextsvc from './eventchild/edittext.js'
import rmosupselgraphsvc from './eventchild/rmosupselgraphsvc.js';
import rmosupsvc from './eventchild/rmosupsvc.js';
import editimagesvc from './eventchild/importimagesvc.js';
import respond2pickpoint from './eventchild/respond2pickpoint.js';
import lmosselgraphsvc from './eventchild/lmosselgraphsvc.js';
import dbClickPackageSvc from './eventchild/dbClickPackageSvc.js';
import { XMindRMosUpSelGraphSvc } from './eventchild/xmind/xmindRMosUpSelGraphSvc.js';

import {LGXEnums}  from '../canvas/common/sysenum.js'
import { GlobalVar } from '../canvas/common/globalvar.js';

var EventFactory = {

}



EventFactory.create = function (eventKind) {
    var evtsvc = null;
    switch (eventKind) {
        case LGXEnums.LGXEventKind.EditTextOnMap:
            evtsvc = new edittextsvc.EditTextSvc();
            break;

        case LGXEnums.LGXEventKind.RMouseUpSelGraph:
            if (GlobalVar.editMode == "xmind"){
                evtsvc = new XMindRMosUpSelGraphSvc();
            }
            else{
                evtsvc = new rmosupselgraphsvc.RMosUpSelGraphSvc();
            }
            break;

        case LGXEnums.LGXEventKind.RMouseUp:
            evtsvc = new rmosupsvc.RMosUpSvc();
            break;

        case LGXEnums.LGXEventKind.StartDrawImageOnMap:
            evtsvc = new editimagesvc.ImportImageSvc();
            break;

        case LGXEnums.LGXEventKind.Respond2PickPoint:
            evtsvc = new respond2pickpoint.Respond2PickPointSvc();
            break;

        case LGXEnums.LGXEventKind.LMouseSelGraph:
            evtsvc = new lmosselgraphsvc.LMosSelGraphSvc();
            break;

        case LGXEnums.LGXEventKind.DBClickUMLPackge:
            evtsvc = new dbClickPackageSvc.DBClickUMLPackageSvc();
            break;
    }
    return evtsvc;
}

export default { EventFactory }